#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 410;
const int M = 1e9 + 7;

int t, n, m;
char A[N][N];

int s[N][N];

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> t;
    while (t--) {
        cin >> n >> m;
        memset(s, 0, sizeof(s));

        for (int i = 1;i <= n;i++)
            for (int j = 1;j <= m;j++) {
                cin >> A[i][j];
                s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + (A[i][j] - '0');
            }


        for (int i = 1; i <= n-5; i++) {

        }
    }
    return 0;
}